﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<projeto_mvc_puc.Models.Pessoa>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Pessoa Jurídica
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Cadastrar Pessoa Jurídica</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Dados principais</legend>

            <div class="editor-label">
                <%: Html.LabelFor(model => model.Nome) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Nome) %>
                <%: Html.ValidationMessageFor(model => model.Nome) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Idade) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Idade) %>
                <%: Html.ValidationMessageFor(model => model.Idade) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.CNPJ) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.CNPJ) %>
                <%: Html.ValidationMessageFor(model => model.CNPJ) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.RazaoSocial) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.RazaoSocial) %>
                <%: Html.ValidationMessageFor(model => model.RazaoSocial) %>
            </div>
        </fieldset>

        <fieldset>
            <legend>Endereço</legend>

            <div class="editor-label">
                <%: Html.LabelFor(model => model.Endereco.Rua) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Endereco.Rua)%>
                <%: Html.ValidationMessageFor(model => model.Endereco.Rua)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Endereco.Numero)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Endereco.Numero)%>
                <%: Html.ValidationMessageFor(model => model.Endereco.Numero)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Endereco.Bairro)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Endereco.Bairro)%>
                <%: Html.ValidationMessageFor(model => model.Endereco.Bairro)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Endereco.Complemento)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Endereco.Complemento)%>
                <%: Html.ValidationMessageFor(model => model.Endereco.Complemento)%>
            </div>
        </fieldset>

        <fieldset>
            <legend>Telefone</legend>

            <div class="editor-label">
                <%: Html.LabelFor(model => model.Telefone.First().Tipo) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Telefone.First().Tipo)%>
                <%: Html.ValidationMessageFor(model => model.Telefone.First().Tipo)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Telefone.First().Numero)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Telefone.First().Numero)%>
                <%: Html.ValidationMessageFor(model => model.Telefone.First().Numero)%>
            </div>
        </fieldset>

        <p>
            <input type="submit" value="Salvar" />
        </p>
    <% } %>

    <div>
        <%: Html.ActionLink("Voltar", "Index") %>
    </div>

</asp:Content>

